#!/usr/bin/python
# -*- coding: utf-8 -*-

"""
User: lyj
DateTime: 2012-04-14 20:27:00

Hello World例子
"""

__author__ = 'lyj'



from demos.rabbitmq.settings import amqp_host, amqp_port
import pika

connection = pika.BlockingConnection(pika.ConnectionParameters(
    host=amqp_host, port=amqp_port))
channel = connection.channel()

channel.queue_declare(queue='hello')

channel.basic_publish(exchange='',
    routing_key='hello',
    body='Hello World!')
print " [x] Sent 'Hello World!'"
connection.close()